/**
 * @title HHUserModel.java
 * @description 	用户模块类文件
 * @create 			2012-7-18 下午09:17:12 By xjiujiu
 * @package 		apps.admin.model
 * @copyright 		Copyright (c) 2011-2012 http://xyrj.hhtc.edu.cn.com. All right reserved
 * @version         $Id$
 * XYRJ-Java-Project
 */

package apps.admin.model;

import java.util.List;
import java.util.Map;

import com.xyrj.core.HHPojo;

/**
 * 用户管理模块类
 * @ClassName: HHDoctorModel 
 * @Description:
 * @author maoyun0903(maoyun19900818@163.com);
 * @date 2012-10-8 下午8:49:04 
 * @version V1.0
 */
public class HHDoctorModel extends HHModelBaseModel
{
	
	/**
	 * 构造函数
	 *
	 * 初始化类成员
	 */
	public HHDoctorModel(HHPojo pojo)
	{
		super();
		this._pojo 	= pojo;
	}
	
	/**
	 * 检测用户登陆信息
	 *  
	 * @description
	 * 
	 * @title  checkLogin
	 * @param  HHPojo pojo 当前用户的POJO对象
	 * @return User
	 */
	@SuppressWarnings("rawtypes")
    public Map checkLogin(HHPojo pojo)
	{
		this._sql.table(pojo.table)
		.fields(new String[]{"doctor_id", "doctor_name", "password"})
		.where(new String[]{
				"`doctor_name` = '" + pojo.getField("doctor_name") + "'" ,
				"AND `password` = '" + pojo.getField("password") + "'"
			}
		);
		List<Map> doctorList 	= this._db.find(this._sql.getSelectSql());
		if(null == doctorList) {
			return null;
		}
		
		return doctorList.get(0);
	}

}